//引入axios
import request from '@/utils/request.js';

//上传文章信息
export function uploadblog(url,data) {
  return request({
    url: url,
    method: 'put',
    data: data,
    headers: {
        'Content-Type': 'application/json',
        addToken: true      // 指示需要在请求头中添加 token
      }
  })
}

//获取用户信息
export function getUsersinfo() {
    const id = localStorage.getItem('UserId');
    const url  = `users/${id}`;
    return request({
      url: url,
      method: 'get',
      params: '',
      headers: {
          'Content-Type': 'application/json',
          addToken: true      // 指示需要在请求头中添加 token
        }
    })
  }